/**
 * @BelongsProject: zzyl-cp423
 * @BelongsPackage: com.zzyl.nursing.controller.member
 * @Author: 王明天
 * @CreateTime: 2025/1/10 20:57
 * @Description: MemberPageQueryController
 */
package com.zzyl.nursing.controller.member;

import com.zzyl.common.core.controller.BaseController;
import com.zzyl.common.core.domain.R;
import com.zzyl.common.core.page.TableDataInfo;
import com.zzyl.nursing.domain.NursingProject;
import com.zzyl.nursing.service.INursingProjectService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 *
 * 微信小程序查询
 */


@RestController
@RequestMapping("/member/orders/project")
public class MemberPageQueryController extends BaseController {


    @Autowired
    private INursingProjectService nursingProjectService;



    /**
     * 小程序分页查询护理项目
     * @return
     */
    @GetMapping("/page")
    public TableDataInfo<List<NursingProject>> pageQueryNursingProject(NursingProject nursingProject) {

        startPage();
        List<NursingProject> list = nursingProjectService.selectNursingProjectList(nursingProject);
        return getDataTable(list);
    }


    /**
     *根据编号查询护理项目信息
     * @param id
     * @return
     */
    @GetMapping("/{id}")
    public R<NursingProject> getInfo(@PathVariable("id") Long id)
    {
        return R.ok(nursingProjectService.selectNursingProjectById(id));
    }
}


